package com.qf.service.impl;

import com.qf.mapper.GoodsCategoryMapper;
import com.qf.pojo.GoodsCategory;
import com.qf.pojo.UserTable;
import com.qf.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private GoodsCategoryMapper mapper;

    @Override
    public List<GoodsCategory> findAll() {
        return mapper.selectByExample(null);
    }

    @Override
    public void addCategory(GoodsCategory goodsCategory) {
         mapper.insertSelective(goodsCategory);
    }

    @Override
    public void deleteCategoryById(Integer id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updateCategory(GoodsCategory goodsCategory) {
        mapper.updateByPrimaryKeySelective(goodsCategory);
    }




}
